package android.framework.rpc.convertor;


public class ConvertorHelper<T,G> {
	
	private IConvertor<T> tConvertor;
	private IConvertor<G> gConvertor;
	
	public ConvertorHelper(IConvertor<T> tConvertor, IConvertor<G> gConvertor) {
		this.tConvertor = tConvertor;
		this.gConvertor = gConvertor;
	}
	
	public T convertTo(G g){
		return tConvertor.convert(gConvertor.convert(g));
	}
	
	public G convertFrom(T t){
		return gConvertor.convert(tConvertor.convert(t));
	}
}
